var mysql =require('mysql');
var connection =mysql.createConnection({
    host:'127.0.0.1',
    user:'root',
    password:'root',
    port:'3306',
    database:'xiaomimall'
});

connection.connect();

connection.query('select * from user',function (error,results,fields) {
    
    if (error) {
        console.log(error.message)
    };

    console.log(results);
});
connection.end();